import { axios } from '@/utils/request'

const api = {
  warehouseType: '/supplier/types',
  list: '/supplier/list',
  add: '/supplier/add',
  edit: '/supplier/edit',
  status: '/supplier/status',
  all: '/supplier/all'
}

/**
 * 获取列表
 */
export function list(params) {
  return axios({
    url: api.list,
    method: 'get',
    params
  })
}

/**
 * 获取仓库接口类型
 * @param params
 * @return {*}
 */
export function getWarehouseType(params) {
  return axios({
    url: api.warehouseType,
    method: 'get',
    params
  })
}

export function changeStatus(params) {
  return axios({
    url: api.status,
    method: 'get',
    params
  })
}

// 添加
export function add(data) {
  return axios({
    url: api.add,
    method: 'post',
    data
  })
}

// 修改
export function edit(data) {
  return axios({
    url: api.edit,
    method: 'post',
    data
  })
}

export function all() {
  return axios({
    url: api.all,
    method: 'get'
  })
}
